home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / editors / emcs1857 / 1857sr~1.zoo / lisp / term / id100.el < prev   
Encoding:
Text File  |  1992-01-24  |  3.1 KB  |  104 lines

  1. ;;; Set up ID Systems Corporation ID-100V terminal.
  2.  
  3. (require 'iso8859-1-ascii)
  4. (require 'char-table-vt100)
  5. (require 'keypad)
  6. (require 'vt100-led)
  7.  
  8. (defvar CSI-map nil
  9.   "The CSI-map maps the CSI function keys on the keyboard.
  10. The CSI keys are the arrow keys.")
  11.  
  12. (if (not CSI-map)
  13.     (progn
  14.      (setq CSI-map (lookup-key global-map "\e["))
  15.      (if (not (keymapp CSI-map))
  16.      (setq CSI-map (make-sparse-keymap)))  ;; <ESC>[ commands
  17.      (setup-terminal-keymap CSI-map '(
  18.         ("A"   . ?u) ; up arrow
  19.     ("B"   . ?d) ; down-arrow
  20.     ("C"   . ?r) ; right-arrow
  21.     ("D"   . ?l) ; left-arrow
  22.     ("H"   . ?h) ; home
  23. ))))
  24.  
  25. (defun enable-arrow-keys ()
  26.   "Enable the use of the ID-100 arrow keys for cursor motion.
  27. Because of the nature of the ID-100, this unavoidably breaks
  28. the standard Emacs command ESC [; therefore, it is not done by default,
  29. but only if you give this command."
  30.   (interactive)
  31.   (global-set-key "\e[" CSI-map)
  32. )
  33.  
  34. (defvar SS3a-map nil
  35.   "SS3a-map maps the SS3 function keys on the ID-100 keyboard.
  36. The SS3 keys are the numeric keypad keys in keypad application mode
  37. \(DECKPAM).  SS3 is DEC's name for the sequence <ESC>O which is
  38. the common prefix of what these keys transmit.")
  39.  
  40. (if (not SS3a-map)
  41.     (progn
  42.      (setq SS3a-map (lookup-key global-map "\eO"))
  43.      (if (not (keymapp SS3a-map))
  44.      (setq SS3a-map (make-keymap)))  ;; <ESC>O commands
  45.      (setup-terminal-keymap SS3a-map
  46.         '(("A" . ?u)       ; up arrow
  47.           ("B" . ?d)       ; down-arrow
  48.           ("C" . ?r)       ; right-arrow
  49.           ("D" . ?l)       ; left-arrow
  50.           ("M" . ?e)       ; Enter
  51.           ("P" . ?\C-a)       ; PF1
  52.           ("Q" . ?\C-b)       ; PF2
  53.           ("R" . ?\C-c)       ; PF3
  54.           ("S" . ?\C-d)       ; PF4
  55.           ("l" . ?,)       ; ,
  56.           ("m" . ?-)       ; -
  57.           ("n" . ?.)       ; .
  58.           ("p" . ?0)       ; 0
  59.           ("q" . ?1)       ; 1
  60.           ("r" . ?2)       ; 2
  61.           ("s" . ?3)       ; 3
  62.           ("t" . ?4)       ; 4
  63.           ("u" . ?5)       ; 5
  64.           ("v" . ?6)       ; 6
  65.           ("w" . ?7)       ; 7
  66.           ("x" . ?8)       ; 8
  67.           ("y" . ?9)))))       ; 9
  68.  
  69. (defun keypad-application-mode ()
  70.   "Switch on keypad application mode."
  71.   (interactive)
  72.   (send-string-to-terminal "\e=")
  73.   (global-set-key "\eO" SS3a-map))
  74.  
  75. (defvar SS3n-map nil
  76.   "SS3n-map maps the SS3 function keys on the ID-100 keyboard.
  77. The SS3 keys are the numeric keypad keys in keypad numeric mode
  78. \(DECKPAM).  SS3 is DEC's name for the sequence <ESC>O which is
  79. the common prefix of what these keys transmit.")
  80.  
  81. (if (not SS3n-map)
  82.     (progn
  83.      (setq SS3n-map (lookup-key global-map "\eO"))
  84.      (if (not (keymapp SS3n-map))
  85.      (setq SS3n-map (make-sparse-keymap)))  ;; <ESC>O commands
  86.      (setup-terminal-keymap SS3n-map '(
  87.           ("P" . ?\C-a)       ; PF1
  88.           ("Q" . ?\C-b)       ; PF2
  89.           ("R" . ?\C-c)       ; PF3
  90.           ("S" . ?\C-d)       ; PF4
  91.      ))
  92.     (global-set-key "\eO" SS3n-map)
  93. ))
  94.  
  95. (standard-char-graphic   176 ?f) ; degree sign
  96. (standard-char-graphic   177 ?g) ; plus or minus sign
  97. (standard-char-graphic   183 ?~) ; middle dot
  98. (standard-frameg-graphic ?x)     ; Vertical bar.
  99. (standard-truncg-graphic ?t)     ; Left T.
  100. (standard-wrapg-graphic  ?k)     ; Upper right corner.
  101.  
  102. (setq start-emphasis "\e[4m") ; Foreground yellow.
  103. (setq stop-emphasis  "\e[m")  ; Foreground white.
  104.